Method for determining bias in an inertial measurement unit of an image acquisition device

ABSTRACT

A method for determining bias in an inertial measurement unit of an image acquisition device comprises mapping at least one reference point within an image frame into a 3D spherical space based on a lens projection model for the image acquisition device to provide a respective anchor point in 3D space for each reference point. For reference points within a given image frame, an estimate of frame-to-frame motion at the reference point between the given frame and a previously acquired frame is obtained; a measure of device orientation for an acquisition time of the reference point in the given frame and the previously acquired frame, the measure including a bias component, is obtained from the inertial measurement unit; a corresponding anchor point is projected in 3D space according to a difference in the measure of device orientation in the given frame and the previously acquired frame to provide a 3D vector V m ; a result of the estimated frame-to-frame motion for the point from the given frame is projected into the previously acquired frame into 3D space to provide a 3D vector V e ; and a cross product V c  of the 3D vectors V m  and V e  is used to update a bias component value.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to and is a continuation of U.S. patent application Ser. No. 16/154,450 filed on Oct. 8, 2018 which is a continuation of U.S. patent application Ser. No. 15/468,409 filed on Mar. 24, 2017, issued on Oct. 9, 2018 as U.S. Pat. No. 10,097,757, the entire contents of which are incorporated herein by reference.

FIELD

The present invention relates to a method for determining bias in an inertial measurement unit of an image acquisition device.

BACKGROUND

It is known that inertial measurement units (IMU) comprising for example, a gyroscope can accurately measure short-term or relative changes in orientation of a device such as a camera, but suffer from a constant error (bias) that can additionally change over time (drift).

This drift can be determined and compensated for by using other sensors including magnetometers, accelerometers or other fiduciary points, but it may be not feasible or desirable to use or add such functionality and cost to a device. It will also be appreciated that even when available, magnetometers themselves need to be periodically re-calibrated and as such could not necessarily be relied upon all of the time to correct for other sensor drift.

In “Bias Compensation of Gyroscopes in Mobiles with Optical Flow”, AASRI Procedia 9, 2014, pp152-157, László Kundra and Péter Ekler consider the problem of using gyroscopes where the integration of raw angular rates with non-zero bias leads to a continuous drift of estimated orientation. A sensor fusion algorithm uses optical flow from the camera of the device. An orientation estimator and bias removal method are based on complementary filters, in combination with an adaptive reliability filter for the optical flow features. The feedback of the fused result is combined with the raw gyroscope angular rates to compensate for the bias.

The problem with this approach is that finding a global transformation between frames and converting it into camera orientation change is extremely CPU intensive. Using the motion vectors directly leads to large errors caused by erroneous motion estimates (outliers). Indeed one potential implementation suggests employing the RANSAC algorithm to reject such outliers when determining optical flow, but this would add significant computational overhead, so making the approach unfeasible or unattractive for implementation in portable image acquisition devices such as smartphones.

It is an object of the present invention to provide an improved method for determining IMU sensor bias.

SUMMARY

According to the present invention there is provided a method for determining bias in an inertial measurement unit of an image acquisition device according to claim 1.

The invention finds particular utility in a device IMU having only a gyroscope. But even when an accelerometer is available, it can only be used to determine bias compensation for all but 1 axis. It is not possible to compensate for the axis parallel to the gravity vector.

In a further aspect there is provided an image processing device arranged to perform the method of claim 1; and a computer program product comprising computer readable instructions, which when executed in an image processing device are arranged to perform the method of claim 1.

BRIEF DESCRIPTION OF THE DRAWINGS

An embodiment of the invention will now be described, by way of example, with reference to the accompanying drawings, in which:

FIG. 1 shows schematically an image acquisition device on which embodiments of the present invention can be implemented;

FIG. 2 shows an exemplary array of motion vectors indicating estimated frame-to-frame movement between two consecutive images;

FIG. 3 shows the mapping of reference points from an image as well as measured IMU motion; and estimated motion into a 3D unit sphere;

FIG. 4 illustrates the difference between the effect of an estimated motion V_(e) and a measured motion V_(m) on an anchor point V in 3D space for a region of an image, as well as the cross product V_(c) of the vectors V_(m) and V_(e); and

FIG. 5 is a flow diagram illustrating a method according to an embodiment of the invention.

DESCRIPTION OF THE EMBODIMENTS

Referring to FIG. 1, image acquisition devices 10 typically comprise an image processing pipeline (IPP) 12 which obtains acquired image data from an image sensor (not shown), conducts basic processing of the raw image data, such as color balancing, and writes acquired images or portions of images via a system bus 20 to system memory 14. Image frames can be acquired by the IPP 12 at frame rates from 24 fps up to from 60 fps to even 240 fps.

Such image acquisition devices 10 can include downstream dedicated image processing units which can analyse acquired images and process such images either to extract information from the images or to correct the images. Such processing can include face detection and tracking, object recognition or distortion correction such as disclosed in PCT Application WO2014/005783 (Ref: FN-384). Other processing can determine frame-to-frame motion, for example, as disclosed in WO2014/146983 (Ref: FN-389) and PCT Application No. PCT/EP2017/050390 (Ref: FN-495), the disclosures of which are incorporated herein by reference.

In the present specification, such processing units, which can be dedicated hardware modules or a generic central processing unit (CPU), are indicated as processing unit (PU) 16 which is capable of running either low-level firmware/software or in the case of the CPU, application software, capable of obtaining image information from memory 14 and further processing the images.

In the present specification, we refer to images being provided by IPP 12, however, it will be appreciated that these can comprise either individually acquired images or images within a video sequence.

It is known for image acquisition devices 10 to include inertial measurement units (IMU) 18 which can indicate a trajectory of device movement during image acquisition, enabling processing unit(s) 16 to use that information to correct an acquired image to take into account blur caused by involuntary or unwanted device motion during image capture or to stabilize video sequences. Indeed PCT Application No. PCT/EP2017/050390 (Ref: FN-495) discloses how such correction can take into account optical image stabilisation (OIS) which might be performed by a lens during image acquisition. Note that the description below is based on the assumption that OIS is switched off, but where known, this could be taken into account in variations of the described embodiment.

The IMU 18 sensors can comprise: gyroscopic sensors providing measures of rotational velocity around each of the three spatial axes (X,Y,Z); and accelerometers which provide measures of translational acceleration during image sequence capture and the direction of the gravitational force. The IMU can further include a magnetometer indicating the absolute angular orientation of the device relative to the earth's magnetic field.

As mentioned above, IMU sensors and gyroscopic sensors, in particular, tend to suffer from bias and drift.

Embodiments of the present invention use image-based motion estimation which, although suffering from noise and other disturbances, over a longer term, can provide an indicator proportional to the bias (B) in an IMU sensor.

Referring to FIG. 2, in one embodiment, an estimate of frame-to-frame image motion such as disclosed in PCT Application WO2014/146983 (Ref: FN-389-PCT) and PCT Application No. PCT/EP2017/050390 (Ref: FN-495-PCT), referred to above is employed.

This estimate comprises a 16×16 array E[ ] of 256 2D motion vectors (two of which E₁, E₂ are indicated—these motion vectors can be stored as circular (polar) or Cartesian coordinates) extending over the input image. Note that in this case, as is common, the image acquisition device employs a rolling shutter technique where one or more lines (rows) of pixels of an image are read from an image sensor during successive exposure intervals.

Also note that an array of motion vectors is provided for exemplary purposes only—any arrangement of motion vectors, even random, could be used.

As such, IMU measurements acquired during frame exposure need to be synchronised or correlated with the acquisition time for the portion of an image providing each row of the estimated motion vector array E[ ]. Thus, for example, the IMU measurements for the row of the movement array containing E₂ will precede those for E₁, assuming the start of field (SOF) is read from the top down. Nonetheless, it will be appreciated that the same interval df applies between a time of acquisition of one portion of an image and the corresponding portion of the image in a previously acquired frame.

Referring to FIG. 3, the present method begins by mapping 256 reference points, each corresponding to a cell of the 16×16 estimated motion vector array E[ ], onto a unit sphere in 3D space using a backward camera projection based on a lens projection model, such as described in PCT Application No. PCT/EP2017/050390 (Ref: FN-495-PCT). The reference points can be taken from the centre of each cell, but this is not essential.

This is a one-off operation and the mapped points act as anchors in 3D space and are used as a reference when processing all frames. In FIG. 3, two such anchor points V1 and V2 extending from the origin O are indicated.

In the next step, the 3D anchor points, such as V1 and V2, are transformed according to their respective locations in a previously acquired frame based on the camera orientation measured by the IMU 18. Thus, the embodiment attempts to determine a location in 3D space corresponding to the position of the reference point V1 according to a difference in its measured orientation at an acquisition time in a given image and its measured orientation at an acquisition time for the same point in the previously acquired image.

This done by determining the time t of acquisition of each estimated motion vector in the array E[ ] (each row shares the same time) in a given frame and the previous frame.

Then the position of the camera measured by the IMU 18 is used to determine the camera orientations for each row of the array E[ ] in the present frame and the previously acquired frame. These measures can be represented in quaternion form as a quaternion function Q(t) representing the camera orientation at time t. Q(t) is obtained by numerical integration of the angular velocity ω sampled at interval dt. The value of ω can be measured by a gyroscope as a vector containing angular velocities around the gyroscope's local coordinate system axes: ω=[ω_(x),ω_(y),ω_(z)]

Without taking into account bias, given the device orientation at the time of the previous gyroscope sample Q(t-dt), an update quaternion {dot over (Q)} can be defined as: {dot over (Q)}=0.5Q(t-dt)·[0,ω]

With dot representing the quaternion multiplication in this case. Thus, a new orientation of the device after an interval dt can be calculated as follows: Q=Q(t-dt)+{dot over (Q)}dt

and this can be normalised as follows:

${Q(t)} = \frac{Q}{Q}$

As explained, the gyroscope measurement contains a constant error called gyroscope bias B=[B_(x), B_(y), B_(z)]. If not removed, bias leads to error accumulation over time that significantly affects the measurement of the device's orientation. When bias is known, the update quaternion formula can have the following form: {dot over (Q)}=0.5Q(t-dt)·[0,ω-B]

Knowing the camera orientation at the time t and the frame interval df it is possible to calculate the location of the point in 3D space represented by V (for example V1, V2) in the previous frame which will be denoted by V_(m): V _(m) =V·(Q(t)⁻¹ ·Q(t-df)).

The power of −1 denotes the quaternion conjugation operation.

It will be seen from the description above that using quaternion functions to determine V_(m) is computationally efficient, but nonetheless determining the coordinates for the vector V_(m) according to the measured orientation for a reference point in a given frame and in a previously acquired frame can also be performed using other techniques such as a rotational matrix.

Now, if we consider one of the motion vectors from the array E[ ] estimated by the means of image analysis being denoted as {right arrow over (E)}={right arrow over (AY)}, where A corresponds to the 2D reference point corresponding to a 3D space anchor point V. Thus, Y represents the location of A in 2D space in the previously acquired frame. Knowing the camera's sensor timing it is possible to determine the time t when the pixel underlying the point A was captured and to correlate this with a measured motion based location for the point V_(m). The point Y, being the result of the 2D motion vector {right arrow over (E)} on a 2D reference point location can also be projected into the 3D space, again using the same lens projection model transformation as for the reference points, to form the estimated vector V_(e) in 3D space.

Thus, knowing the measured orientation V_(m) in 3D space at the same time as the end points of each estimated motion vector, we can provide a corresponding estimated orientation V_(e) in 3D space.

In an ideal case, where no measurement and estimation errors were present, the measured and estimated motions should have the same effect (V_(m)=V_(e)). However, in a real life situation, there will be some error V_(m)≠V_(e) as indicated by the differences between: V_(m1) and V_(e1); and V_(m2) and V_(e2) in FIG. 3; and by the difference between V_(m) and V_(e) in FIG. 4.

It will be appreciated that any estimated motion vector {right arrow over (E)} within the array E[ ] and its counterpart in 3D space V_(e) can contain errors, either due to noise or due to object motion within a scene being imaged. Nonetheless, a component of the difference comprises a systematic error caused by IMU sensor bias and the present method attempts to identify this error in as efficient as manner as possible.

As suggested in László Kundra and Péter Ekler, one approach to identifying the systematic error would be to use the least squares method to estimate a rotation matrix between measured and estimated vectors V_(m), V_(e). However, due to what may be a significant number of outliers in the motion matrix, a method such as RANSAC would be needed to reliably determine this rotation matrix and that would consume a significant amount of CPU power. Also, the rotation matrix would have to be converted to rotation angles to compensate for gyro bias and this would add several costly trigonometrical functions.

On the other hand, referring to FIG. 4, the present embodiment utilises a cross product of the 3D vectors determined above: V _(c) =V _(m) ×V _(e)

as this is closely related to the angle between V_(m) and V_(e) and this value can be used to apply a correction to the bias estimation B used above.

A simple use of the measure V_(c) would be to take an average/mean of the values for at least some of the cells of the array E[ ] over a frame or a number of frames. However, such a measure would be subject to a high level of noise as the estimated motion measurements in particular can contain significant outliers caused by parallax and moving objects. Those outliers would likely affect the mean values in a significant way introducing high estimation errors.

On the other hand, using a median value tends to more effectively eliminate outliers. However, this generally requires:

-   -   a significant amount of memory to keep corrections for all         vectors V_(c), potentially for a number of past frames, to         provide a reliable median measure; and     -   sorting of a large amount of data, for example, even sorting 256         measurements for every frame would be a challenge for a portable         device CPU or processing module.

In some embodiments, an estimate of median value M which does not require memory or sorting is employed. A recursive formula for one such estimate M of the k-th sample is as follows: M _(k) =M _(k-1)+η sign(s _(k)-M _(k-1)),

where η is a very small value (e.g. 0.000001) and s is the current sample value.

In the present case, this approach can be used to update an estimate for the bias vector B directly from cross-product vector V_(c) as follows: B=B ⁻¹+η sign(V _(c)),

where B⁻¹ denotes the bias estimate from the previous iteration.

This bias value B can then be used in the quaternion measurements above to provide a more accurate measurement of camera orientation at any given instant in real-time. Every time the quaternion update is calculated, the most recent estimate of B is used. This provides constant updates of correction even with the bias drifting over time.

It will be seen that using this embodiment, the bias component is updated as a function of information derived from a number of frames, yet without the processing burden of needing to store values and determine a median for a large number of values.

In refinements of the above disclosed embodiments, only selected vectors within any given estimated motion vector array E[ ] marked as valid after motion estimation are used in bias estimation. Indeed, validity or weight factors for the motion vectors {right arrow over (E)} of the array E[ ] can be used to improve robustness of the bias estimate. Also, in the case of a scene with no details or extremely fast motion that results in rejection of all the vectors of the array E[ ], the last known bias estimate can still be used. This way erroneous or exceptional situations do not affect bias estimation or prevent calculation of camera orientation.

Referring now to FIG. 5, the above described method can be summarised as follows. At step 50, reference points corresponding to cells within an estimated motion vector array E[ ] for an image are mapped to anchor points in a 3D spherical space using the lens projection model. At step 52 a new frame is acquired. At step 54, the estimated motion vector array E[ ] is calculated for the acquired frame relative to a previously acquired frame. At step 56, for each at least some of the cells of the estimated motion array E[ ], for example those indicating valid motion measures, the corresponding reference point, transformed according to the 2D motion vector for the cell is mapped into 3D spherical space using the lens projection model to provide vector V_(e) in 3D space. At step 58, using orientation measurements provided by the inertial measurement unit, the anchor point corresponding to the cell is transformed according to the difference between the measured orientation for an acquisition time of the cell for the present frame and for the time of acquisition of the cell in the previously acquired frame to provide vector V_(m) in 3D space. (It will be appreciated that steps 56 and 58 can be reversed.) At step 60, the cross product V_(c) of vectors V_(e) and V_(m) is determined. At step 62, the sign of the cross product is used to update the bias estimate. The method now returns to step 52 to process the next motion vector, if any remain for the frame.

This method can be readily extended to work with other motion estimation methods than disclosed in WO2014/146983 (Ref: FN-389) and PCT Application No. PCT/EP2017/050390 (Ref: FN-495). For example, motion estimation can be based on tracked or matched feature points from within a scene being imaged without any significant changes to the method.

Thus the reference points within a frame for which measured orientations and orientations based on estimated motion are determined and compared do not need to be distributed regularly across a frame or even to extent across an entire frame. 

The invention claimed is:
 1. A method comprising: receiving, from an image acquisition device, first image data associated with a first time and second image data associated with a second time; determining a first motion vector based at least in part on the first image data and the second image data; receiving, from an inertial measurement unit associated with the image acquisition device, a first orientation measurement associated with the first time and a second orientation measurement associated with the second time; determining a second motion vector based at least in part on the first orientation measurement and the second orientation measurement; determining a third vector based at least in part on a cross product of the first motion vector and the second motion vector; and determining a value indicating a bias of the inertial measurement unit, based at least in part on the third vector.
 2. The method of claim 1, wherein determining the value indicating the bias of the inertial measurement unit comprises: performing a sign operation on the third vector.
 3. The method of claim 1, wherein determining the first motion vector comprises: determining a first point within the first image data; determining a second point within the second image data, wherein the second point corresponds to the first point; determining a motion based on the first point and the second point; and projecting the motion in a three-dimensional spherical space.
 4. The method of claim 3, wherein determining the second motion vector comprises: determining a difference between the first orientation measurement and the second orientation measurement; and projecting a reference point in the three-dimensional spherical space, based at least in part on the difference between the first orientation measurement and the second orientation measurement.
 5. The method of claim 3, further comprising: determining a third point within the first image data; determining a fourth point within the second image data, wherein the fourth point corresponds to the third point; determining a second motion based on the third point and the fourth point; and determining a third motion vector based at least in part on the second motion, wherein the value indicating the bias of the inertial measurement unit is determined based at least in part on the third motion vector.
 6. The method of claim 5, further comprising: detecting frame-to-frame movement between one or more portions of a first image frame and one or more corresponding portions of a second image frame, wherein the first image frame corresponds to the first image date and the second image frame corresponds to the second image data; and selecting the first point and the third point based on the frame-to-frame movement, wherein the first point and the third point are within the one or more portions of the first image frame.
 7. The method of claim 1, further comprising: configuring the image acquisition device based on the value indicating the bias of the inertial measurement unit.
 8. The method of claim 4, further comprising: prior to receiving the first image data and the second image data, generating a plurality of image frames by the image acquisition device, wherein the first image data corresponds to a first image frame and the second image data corresponds to a second image frame captured subsequent to the first image frame.
 9. A device comprising: an image capture sensor; an inertial measurement sensor; at least one processor; and memory storing instructions that, when executed by the at least one processor, cause the device to perform operations comprising: capturing, using the image capture sensor, first image data associated with a first time and second image data associated with a second time; determining a first vector based at least in part on the first image data and the second image data; determining, using the inertial measurement sensor, a first orientation measurement associated with the first time and a second orientation measurement associated with the second time; determining a second vector based at least in part on the first orientation measurement and the second orientation measurement; determining a third vector based at least in part on a cross product of the first vector and the second vector; and determining, based at least in part on the third vector, a value indicating a bias of the inertial measurement sensor.
 10. The device of claim 9, wherein determining the value indicating the bias of the inertial measurement sensor comprises: performing a sign operation on the third vector.
 11. The device of claim 9, wherein determining the first vector comprises: determining a first point within the first image data; determining a second point within the second image data, wherein the second point corresponds to the first point; determining a motion based on the first point and the second point; and projecting the motion in a three-dimensional spherical space.
 12. The device of claim 11, wherein determining the second vector comprises: determining a difference between the first orientation measurement and the second orientation measurement; and projecting a reference point in the three-dimensional spherical space, based at least in part on the difference between the first orientation measurement and the second orientation measurement.
 13. The device of claim 11, the operations further comprising: determining a third point within the first image data; determining a fourth point within the second image data, wherein the fourth point corresponds to the third point; determining an additional motion based on the third point and the fourth point; and determining a third vector based at least in part on the additional motion, wherein the value indicating the bias of the inertial measurement sensor is determined based at least in part on the third vector.
 14. The device of claim 13, the operations further comprising: detecting frame-to-frame movement between one or more portions of a first image frame and one or more corresponding portions of a second image frame, wherein the first image frame corresponds to the first image date and the second image frame corresponds to the second image data; and selecting the first point and the third point based on the frame-to-frame movement, wherein the first point and the third point are within the one or more portions of the first image frame.
 15. The device of claim 9, the operations further comprising: configuring the device based on the value indicating the bias of the inertial measurement sensor.
 16. The device of claim 9, the operations further comprising: prior to receiving the first image data and the second image data, capturing a plurality of sequential image frames by the image capture sensor, wherein the first image data corresponds to a first image frame and the second image data corresponds to a second image frame captured immediately subsequent to the first image frame.
 17. One or more non-transitory computer-readable media storing instructions executable by a processor, wherein the instructions, when executed, cause the processor to perform operations comprising: receiving, from an image acquisition device, first image data associated with a first time and second image data associated with a second time; determining a first vector, based at least in part on a first position of a reference point in, the first image data and a second position of the reference point in the second image data; projecting the first vector into a three-dimensional space; receiving, from an inertial measurement unit associated with the image acquisition device, a first orientation measurement associated with the first time and a second orientation measurement associated with the second time; determining a second vector, based at least in part on the first orientation measurement and the second orientation measurement; projecting the second vector into the three-dimensional space; and determining, based at least in part on the first vector and the second vector, a value indicating a bias of the inertial measurement unit.
 18. The one or more non-transitory computer-readable media of claim 17, wherein determining the value indicating the bias of the inertial measurement unit further comprises: determining a cross product of the first vector and the second vector.
 19. The one or more non-transitory computer-readable media of claim 17, the operations further comprising: determining a first motion based on a positon difference of the reference point; mapping the first vector within the three-dimensional space, based on the first motion; determining a second motion based on a position difference of a second reference point within the first image data and the second image data; and mapping a second vector within the three-dimensional space, based on the second motion. 